<?php
/**
 * Core controller for all modules
 *
 * This is a default controller shared by predefined 
 * modules
 *
 * @category   
 * @package    
 * @subpackage 
 * @copyright 
 * @author     Sandeep Manne<sandeep.manne@costrategix.com>
 */

require_once "Core/Controller/Action.php";
require_once "account/models/Account.php";
require_once "acl/models/Acl.php";

abstract class CoreController extends Core_Controller_Action
{
	public function init()
	{
		$identity = Account::getIdentity();
		if (!Acl::isAllowed($identity['group_id'], 
					   $this->getRequest()->getModuleName(), 
					   $this->getRequest()->getControllerName(),
					   $this->getRequest()->getActionName())
		) {
			//throws access denied exception, is this ok
			throw new Exception("Access Denied", "007");		
		}
	}
	
}